<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<form action="#">
    <input type="text" >
    <textarea name="" cols="30" rows="10"></textarea>
    <button type="reset">重置</button>
    <button type="submit">提交</button>
</form>
<script>
    const formEl = document.querySelector('form')
    /*注意 是对form进行监听*/
    formEl.addEventListener('reset',()=>{
        console.log('表单被重置了')
    })
    formEl.addEventListener('submit',(event)=>{
        /*阻止默认事件的发生*/
        event.preventDefault()
    })
</script>
</body>
</html>